package com.ruoyi.partybuilding.domain;

import com.easy.query.core.basic.extension.version.VersionIntStrategy;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.partybuilding.common.EQuery.EQueryEntityLong;
import com.ruoyi.partybuilding.common.EQuery.IDeptEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

import com.easy.query.core.annotation.*;

/**
 * 商城积分;
 * @author : He-LiangLiang@Outlook.com
 * @date : 2025-1-24
 */
@ApiModel(value = "商城积分",description = "")
@Table("pb_mall_points")
@Data
public class MallPoints   extends EQueryEntityLong{

    /** 用户 */
    @ApiModelProperty(value = "用户",notes = "")
    @EasyWhereCondition(type = EasyWhereCondition.Condition.EQUAL)
    private Long userId ;
    /** 来源 */
    @ApiModelProperty(value = "来源",notes = "")
    private String source ;
    /** 获得积分 */
    @ApiModelProperty(value = "获得积分",notes = "")
    private Double points ;
    /** 总积分 */
    @ApiModelProperty(value = "总积分",notes = "添加后的总积分")
    private Double total ;
    /** 备注 */
    @ApiModelProperty(value = "备注",notes = "")
    private String remark ;
    /** 更新人 */
    @ApiModelProperty(value = "更新人",notes = "")
    private String updateBy;
    /** 更新时间 */
    @ApiModelProperty(value = "更新时间",notes = "")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime=new Date() ;
    /** 乐观锁 */
    @ApiModelProperty(value = "乐观锁",notes = "")
    @Version(strategy =VersionIntStrategy.class)
    private Integer revision ;

    public void totalSetBy(double oldTotal){
        total=oldTotal+points;
    }

}